﻿//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

using System;
using System.Collections.Generic;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml;
namespace SDKTemplate
{
    public partial class MainWindow : Window
    {
        public const string FEATURE_NAME = "FAST";

        List<Scenario> scenarios = new List<Scenario>
        {
 
        };

    }

    public class Scenario
    {
        public string Title { get; set; }
        public Type ClassType { get; set; }
    }

    public enum NotifyType
    {
        StatusMessage,
        ErrorMessage
    };
}

namespace FASTControlUI
{
    public enum DeviceType
    {
        HidDevice,
        Serial,    // Can be any device
        None
    }

    public class OnDeviceConnectedEventArgs
    {
        private Boolean isDeviceSuccessfullyConnected;
        private Windows.Devices.Enumeration.DeviceInformation deviceInformation;

        public OnDeviceConnectedEventArgs(Boolean isDeviceSuccessfullyConnected, Windows.Devices.Enumeration.DeviceInformation deviceInformation)
        {
            this.isDeviceSuccessfullyConnected = isDeviceSuccessfullyConnected;
            this.deviceInformation = deviceInformation;
        }

        public Boolean IsDeviceSuccessfullyConnected
        {
            get
            {
                return isDeviceSuccessfullyConnected;
            }
        }

        public Windows.Devices.Enumeration.DeviceInformation DeviceInformation
        {
            get
            {
                return deviceInformation;
            }
        }
    }

    public class DeviceProperties
    {
        public const String DeviceInstanceId = "System.Devices.DeviceInstanceId";
    }

    public class FASTDevice
    {
        /// <summary>
        /// Only available for Input/Output Reports
        /// </summary>
        public class ReadWriteBufferControlInformation
        {
            public const UInt16 ReportId = 0x01;
            public const UInt16 VolumeUsagePage = 0x0C;
            public const UInt16 VolumeUsageId = 0xE0;
            public const Byte VolumeDataStartBit = 4;  // Numeric data starts on bit 4
            public const UInt16 ButtonUsagePage = 0x09;
            public static UInt16[] ButtonUsageId = { 1, 2, 3, 4 };
            public static Byte[] ButtonDataMask = {
                0x01, // Button 1
                0x02, // Button 2
                0x04, // Button 3
                0x08, // Button 4
            };
        }
        public class DeviceInputReportControlInformation
        {
            public const UInt16 ReportId = 0x03;
            public const UInt16 UsagePage = 0xFF00;
            public const UInt16 UsageId = 0x01;
            public const Byte DataTurnOn = 0x01;
            public const Byte DataTurnOff = 0x00;
        }

        public class Device
        {
            public const UInt16 Vid = 0x1A86;
            public const UInt16 Pid = 0xE6E1;
            public const UInt16 UsagePage = 0xff01;
            public const UInt16 UsageId = 0x1;
        }
    }
}
